/*
 *  MutationOperator.h
 *  Genetski
 *
 *  Created by Srđan Rašić on 11/19/11.
 *
 */


#pragma once
#include "Chromosome.h"

/**
 * Defines interface for mutation operators.
 */
class MutationOperator {
protected:
	
public:
	/**
	 * Mutates referenced chromosome.
	 * @param chm Reference to chromosome.
	 */
	virtual void Mutate(Chromosome& chm) = 0;
};


/**
 * Performs mutation of chromosome bits based on
 * pseudorandom generated probability value.
 */
class ProbabilityMutationOperator : public MutationOperator {
private:
	double _bitMutationProbability;
	
public:
	/**
	 * Set's up operator.
	 * @param bitMutationProbability Probability of bit mutation.
	 */
	ProbabilityMutationOperator(double bitMutationProbability);
	
	virtual void Mutate(Chromosome& chm);	
};